Load the imagery package previously installed via devtools:
library(imageRy)
Let’s import tha data by listing them in imageRy:
im.list()
## [1] "dolansprings_oli_2013088_canyon_lrg.jpg"
## [2] "EN_01.png"
## [3] "EN_02.png"
## [4] "EN_03.png"
## [5] "EN_04.png"
## [6] "EN_05.png"
## [7] "EN_06.png"
## [8] "EN_07.png"
## [9] "EN_08.png"
## [10] "EN_09.png"
## [11] "EN_10.png"
## [12] "EN_11.png"
## [13] "EN_12.png"
## [14] "EN_13.png"
## [15] "greenland.2000.tif"
## [16] "greenland.2005.tif"
## [17] "greenland.2010.tif"
## [18] "greenland.2015.tif"
## [19] "info.md"
## [20] "iss063e039892_lrg.jpg"
## [21] "matogrosso_ast_2006209_lrg.jpg"
## [22] "matogrosso_l5_1992219_lrg.jpg"
## [23] "NDVI_rainbow_legend.png"
## [24] "NDVI_rainbow.png"
## [25] "sentinel.dolomites.b2.tif"
## [26] "sentinel.dolomites.b3.tif"
## [27] "sentinel.dolomites.b4.tif"
## [28] "sentinel.dolomites.b8.tif"
## [29] "sentinel.png"
## [30] "Solar_Orbiter_s_first_views_of_the_Sun_pillars.jpg"
Importing the Mato Grosso area image:
mato1992 <- im.import("matogrosso_l5_1992219_lrg.jpg")
## Warning: [rast] unknown extent
Importing the Mato Grosso area image without warnings:
mato1992 <- im.import("matogrosso_l5_1992219_lrg.jpg")
Making a new plot of the Mato Grosso area with the NIR ontop of the green component of the RGB space:
im.plotRGB(mato1992, r=2, g=1, b=3)
Plotting several images altogether:
par(mfrow=c(2,2))
im.plotRGB(mato1992, r=1, g=2, b=3)
im.plotRGB(mato1992, r=2, g=1, b=3)
im.plotRGB(mato1992, r=3, g=2, b=1)
im.plotRGB(mato1992, r=1, g=3, b=1)
Calculating spectral indices:
library(terra)
## terra 1.7.39
library(viridis)
## Loading required package: viridisLite
dvi <- mato1992[[1]]-mato1992[[2]]
viridisc <- colorRampPalette(viridis(7))(255)
plot(dvi, col=viridisc)
Calculating variability:
sd5 <- focal(mato1992[[1]], matrix(1/25, 5, 5), fun=sd)
plot(sd5, col=viridisc)